package Test;

import java.util.Scanner;
public class GirlFriendTest {
    public static void main(String[] args) {

        GirlFriend PenPen = new GirlFriend();

        PenPen.setHobby("爱吃辣、喜欢跳舞");
        PenPen.getHobby();
        //
        PenPen.setName("PenYaFen");
        //PenPen.setTime = "1年";
        PenPen.getName();
        //
        PenPen.setDislike("不喜欢芝麻、肉松");
        PenPen.getDislike();
        //
        //PenPen.age，当被private修饰后不可再这样赋值
        PenPen.setAge(21);
        PenPen.getAge();


        System.out.println("今天有没有和她聊天（1有/0没有）：");
        Scanner sc = new Scanner(System.in);
        int talk = sc.nextInt();

        while(true){
            if (talk == 1){
                PenPen.happy();
                break;
            } else if (talk == 0) {
                PenPen.angry();
                break;
            }else {
                System.out.println("输入错误，重新输入：");
                talk = sc.nextInt();
            }
        }
    }
}
